<template>
    <div class="home">
        <kt-header title="测试"></kt-header>
        <kt-content>
            <el-button @click="GetHtml">获取数据</el-button>
            <el-button @click="GetData">获取数据</el-button>
            <el-button @click="Test">跳转</el-button>
            <kt-markdown ref="markdownEditor" v-model="content" :getHtml="GetHtml" height="300px"></kt-markdown>
        </kt-content>

        <kt-markdown ref="markdownEditor" v-model="content" :options="{hideModeSwitch:true,previewStyle:'tab'}" height="200px"/>
        <div v-html="html"/>
    </div>
</template>

<script>
export default {
    data() {
        return {
            content:"",
            html:'',
        }
    },
    mounted() {
        this.initEditor()
    },
    methods:{
        initEditor() {
            
        },
        GetData(){
            alert(this.content);
        },
        Test(){
            this.$router.push({ path: "/test"});
        },
        GetHtml(){
            this.html = this.$refs.markdownEditor.getHtml()
            console.log(this.html)
        },
    }
}
</script>
<style>
.div{
    background-color: blue;
}

</style>
